import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    currentUser: window.localStorage.getItem("userInfo")? JSON.parse(window.localStorage.getItem("userInfo")):'',
    currentCategory: ''
  },
  mutations: {
    login(state, userInfo) {
      state.currentUser = userInfo
      window.localStorage.setItem("userInfo", JSON.stringify(userInfo))
    }
  },
  actions: {
  },
  modules: {
  }
})
